home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / CHDER.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  479b  |  20 lines

  1. PROCEDURE chder(a,b: real; c: glcarray; VAR cder: glcarray; n: integer);
  2. (* Programs using routine CHDER must define the type glcarray
  3. as in routine CHEBFT. *)
  4. VAR
  5.    j: integer;
  6.    con: real;
  7. BEGIN
  8.    cder[n] := 0.0;
  9.    cder[n-1] := 2*(n-1)*c[n];
  10.    IF (n >= 3) THEN BEGIN
  11.       FOR j := n-2 DOWNTO 1 DO BEGIN
  12.          cder[j] := cder[j+2]+2*j*c[j+1]
  13.       END
  14.    END;
  15.    con := 2.0/(b-a);
  16.    FOR j := 1 TO n DO BEGIN
  17.       cder[j] := cder[j]*con
  18.    END
  19. END;
  20.